Switch to the new way of activating default.
* widget for the window containing the entry. This usually means that
* the dialog box containing the entry will be closed, since the default
* widget is usually one of the dialog buttons.
- *
- * (For experts: if @setting is %TRUE, the entry calls
- * gtk_window_activate_default() on the window containing the entry, in
- * the default handler for the #GtkEntry::activate signal.)
**/
void
gtk_entry_set_activates_default (GtkEntry *entry,
* non-%NULL, this will be called to add additional entries to the context
* menu when it is displayed.
* @activate: Class handler for the #GtkEntry::activate signal. The default
- * implementation calls gtk_window_activate_default() on the entry’s top-level
- * window.
+ * implementation activates the gtk.activate-default action.
* @move_cursor: Class handler for the #GtkEntry::move-cursor signal. The
* default implementation specifies the standard #GtkEntry cursor movement
* behavior.
gtk_text_real_activate (GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- GtkWindow *window;
- GtkWidget *default_widget, *focus_widget;
- GtkWidget *toplevel;
- GtkWidget *widget;
-
- widget = GTK_WIDGET (self);
if (priv->activates_default)
- {
- toplevel = gtk_widget_get_toplevel (widget);
- if (GTK_IS_WINDOW (toplevel))
- {
- window = GTK_WINDOW (toplevel);
-
- if (window)
- {
- default_widget = gtk_window_get_default_widget (window);
- focus_widget = gtk_root_get_focus (GTK_ROOT (window));
- if (widget != default_widget &&
- !(widget == focus_widget && (!default_widget || !gtk_widget_get_sensitive (default_widget))))
- gtk_window_activate_default (window);
- }
- }
- }
+ gtk_widget_activate_default (GTK_WIDGET (self));
}
static void
* non-%NULL, this will be called to add additional entries to the context
* menu when it is displayed.
* @activate: Class handler for the #GtkText::activate signal. The default
- * implementation calls gtk_window_activate_default() on the entry’s top-level
- * window.
+ * implementation activates the gtk.activate-default action.
* @move_cursor: Class handler for the #GtkText::move-cursor signal. The
* default implementation specifies the standard #GtkText cursor movement
* behavior.